home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 1999 May / SGI IRIX 6.5 Applications 1999 May.iso / dist / demos.idb / usr / demos / Demo_Interfaces / Buttonfly / buttonfly.sh.z / buttonfly.sh
Encoding:
Linux/UNIX/POSIX Shell Script  |  1999-04-09  |  2.0 KB  |  68 lines

  1. #!/bin/sh
  2. #Tag 0x9039
  3. #
  4. # Buttonfly launcher script
  5. #       
  6. # Updated Tue Jul 16 20:06:40 PDT 1996 Diana Starr
  7. # Updated Thu Dec 04 10:50:30 PST 1997 Bob Penrod
  8. # -------------------------------------------------------------
  9. # If there are some arguments, try to run buttonfly with them.
  10. # Check for audio flag first, 
  11. # If remaining args not empty then assume the remaining is a path.
  12. # Otherwise do same stuff would do if no args but add audio tag:
  13. #
  14. # Otherwise see if there are some menus in the local directory 
  15. # but if not, then run from the default buttonfly location
  16. # -------------------------------------------------------------
  17.  
  18.  
  19.   if [ $# != 0 ]
  20.     then
  21.         if [ $1 = "-a" ]
  22.         then 
  23.             shift 
  24.             if [ $1 ]
  25.             then
  26.               # Arguments included audio flag and hopefully remaining is a path 
  27.               cd $*
  28.               sh -c "/usr/demos/Demo_Interfaces/Buttonfly/buttonfly -a "
  29.  
  30.             else
  31.  
  32.               # Arguments were audio flag and no path - check for local menus 
  33.               localdir=`pwd`
  34.               localfiles=`ls $localdir/.menu`
  35.               if [ $localfiles ]
  36.               then
  37.                  sh -c "/usr/demos/Demo_Interfaces/Buttonfly/buttonfly -a "
  38.               else
  39.               # Args were audio flag but no path or local menus so run default
  40.                  cd /usr/demos/Demo_Interfaces/Buttonfly
  41.                  sh -c "/usr/demos/Demo_Interfaces/Buttonfly/buttonfly -a"
  42.               fi
  43.            fi
  44.        else 
  45.           # Argument passed to script was a path only
  46.           cd $*
  47.           sh -c "/usr/demos/Demo_Interfaces/Buttonfly/buttonfly "
  48.       fi
  49.  
  50.   else
  51.  
  52.     # No arguments passed to script
  53.     localdir=`pwd`
  54.     if [ -r $localdir/.menu ]
  55.      then
  56.          localfiles=`ls $localdir/.menu`
  57.     fi
  58.  
  59.     if [ $localfiles ]
  60.      then
  61.          sh -c "/usr/demos/Demo_Interfaces/Buttonfly/buttonfly"
  62.      else
  63.          cd /usr/demos/Demo_Interfaces/Buttonfly
  64.          sh -c "/usr/demos/Demo_Interfaces/Buttonfly/buttonfly"
  65.      fi
  66.   fi
  67.  
  68.